initNewsList();
//滚动新闻
function initNewsList() {
    var html = "";
    $.ajax({
        type: "post",
        async: true,//异步，如果等于false 那么就是同步
        url: cochoApp.baseUrl + "/customer/news/getNewsList.do",
        dataType: "json",
        data: "",
        success: function (data) {
            if (data != null) {
                if (data.statusCode == cochoApp.SUCCESS) {
                    if (data.statusCode == "SUCCESS" && data.dataRows.length > 0) {
                        for (var i = 0; i < data.dataRows.length; i++) {
                              var module = data.dataRows[i];
                              html = html +"<a href="+cochoApp.baseUrl+"/control/news/news_display_info.jsp?currentNews=news_display_info&newsId=" + module.newsId + " target='_blank'>"
                                 +""+module.newsTitle+""
                                 +"</a>&nbsp;&nbsp;&nbsp;"
                        }
                        $(".main_list").append(html);
                    }
                } else {
                    cochoAlert.notificationsWarn(data.statusMsg);
                    return false;
                }
            }
        },
        error: function (data) {
            cochoAlert.notificationsWarn(cochoErrorMessage.server_error_connect_admin);
            return false;
        }
    });
}

/*var userInfo = cochoApp.getUserInfoByStorage();
var roles = userInfo.roles;
if(roles == "ADMIN"){
    initMemberCount();
    $("#memberInfo").css('display','block');
}*/

//统计会员数量
/*var memberCount;
function initMemberCount(){
    $.ajax({
        type: "post",
        async: true,//异步，如果等于false 那么就是同步
        url: cochoApp.baseUrl + "/customer/member/getMemberCount.do",
        dataType: "json",
        data: "",
        success: function (data) {
            if (data != null) {
                if (data.statusCode == cochoApp.SUCCESS) {
                    if (data.dataRows.length > 0) {
                        memberCount = data.dataRows[0];
                        $("#memberCount").html(memberCount.memberCount);
                        $("#activatedCount").html(memberCount.activatedCount);
                        $("#inactiveCount").html(memberCount.inactiveCount);
                    }
                } else {
                    $("#memberCount").html(0);
                    $("#activatedCount").html(0);
                    $("#inactiveCount").html(0);
                }
            }
        },
        error: function (data) {
            cochoAlert.notificationsWarn(cochoErrorMessage.server_error_connect_admin);
            return false;
        }
    });
}*/



